<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Layout Example</title>
  <style>
    /* 全局样式重置 */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      border: 5px solid blue;
      margin: 10px;
      border-radius: 5px;
      overflow: hidden;
    }

    /* 顶部容器样式 */
    .top-container {
      display: flex;
      border-bottom: 2px solid white;
    }

    /* 顶部左侧样式 */
    .top-left {
      flex: 1;
      background-color: orange;
      border: 2px solid blue;
      padding: 10px;
      color: red;
      font-size: 20px;
    }

    /* 顶部右侧样式 */
    .top-right {
      position: relative;
      flex: 1;
      background-color: orange;
      border: 2px solid blue;
    }

    /* 下拉菜单按钮样式 */
    .dropdown-btn {
      position: absolute;
      top: 5px;
      right: 5px;
      background-color: blue;
      color: white;
      border: none;
      padding: 5px 10px;
      cursor: pointer;
    }

    /* 下拉菜单内容样式 */
    .dropdown-content {
      display: none;
      position: absolute;
      top: 30px;
      right: 0;
      background-color: orange;
      border: 2px solid blue;
      width: 80px;
    }

    /* 下拉菜单项样式 */
    .dropdown-content div {
      color: white;
      padding: 5px;
      cursor: pointer;
      border-bottom: 1px solid white;
    }

    /* 鼠标悬停显示下拉菜单 */
    .top-right:hover .dropdown-content {
      display: block;
    }

    /* 九宫格容器样式 */
    .grid-container {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      border: 2px solid blue;
    }

    /* 九宫格项样式 */
    .grid-item {
      background-color: orange;
      border: 2px solid blue;
      height: 150px;
    }

    /* 底部样式 */
    .bottom {
      background-color: blue;
      height: 50px;
      border: 2px solid blue;
      margin: 10px;
    }
  </style>
</head>

<body>
  <!-- 顶部容器 -->
  <div class="top-container">
    <div class="top-left">1</div>
    <div class="top-right">
      <button class="dropdown-btn">菜单</button>
      <div class="dropdown-content">
        <div>菜单1</div>
        <div>菜单2</div>
        <div>菜单3</div>
        <div>菜单4</div>
      </div>
    </div>
  </div>

  <!-- 九宫格容器 -->
  <div class="grid-container">
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
    <div class="grid-item"></div>
  </div>

  <!-- 底部区域 -->
  <div class="bottom"></div>
</body>

</html>